home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / admin-v1.000 / admin-v1 / README.login < prev    next >
Text File  |  1995-05-20  |  591b  |  28 lines

  1. This routine adds some help in tracking users.  
  2.  
  3. Add the following to your /etc/profile:
  4.  
  5. ---BEGIN---
  6. # track login
  7. USER=`whoami`
  8. LOGNAME=`logname`
  9. TTY=`tty`
  10. export USER LOGNAME TTY
  11. echo "LOGIN .$LOGNAME.$TTY.`date`" >> /usr/adm/logins
  12. trap 1 2 3   # signals are restored
  13. #
  14. # set the trap for logout
  15. #
  16. trap "/sbin/checkout $LOGNAME $TTY" 0
  17. ---END---
  18.  
  19. You can see all it does is to build a new logfile called logins, writes 
  20. the username, tty and date of login.
  21.  
  22. Then when they exit it calls a script called `checkout` and writes the same
  23. information with updated date/time.
  24.  
  25. Emmett Sauer
  26.  
  27.  
  28.